In [1]:
%matplotlib inline

from matplotlib import pyplot as plt
import matplotlib.mlab as mlab
import csv
from scipy.stats import norm
import numpy as np
import scipy.stats as stats
import numpy

In [2]:
data = open('../data/data.csv', 'r').readlines()
fieldnames = ['x', 'y', 'z', 'unmasked', 'synapses']
reader = csv.reader(data)
reader.next()

rows = [[int(col) for col in row] for row in reader]

In [3]:
sorted_x = sorted(list(set([r[0] for r in rows])))
sorted_y = sorted(list(set([r[1] for r in rows])))
sorted_z = sorted(list(set([r[2] for r in rows])))

In [4]:
count= 0

barx = []
bary = []
barz = []

In [5]:
for i in sorted_x:
    count = sum([r[-1] for r in rows if r[0] == i])
    barx.append(count)
    count = 0
    
for i in sorted_y:
    count= sum([r[-1] for r in rows if r[1] == i])
    bary.append(count)
    count = 0
    
for i in sorted_z:
    count= sum([r[-1] for r in rows if r[2] == i])
    barz.append(count)
    count = 0

In [14]:
x = sorted_x
y = barx
plt.bar(x,y, 35, color = "blue")
plt.show()



In [47]:
x = sorted_y
y = bary
plt.bar(x,y)
plt.show()



In [48]:
x = sorted_z
y = barz
plt.bar(x,y)
plt.show()



In [19]:
fig = plt.figure()
ax = plt.subplot(111)
ax.bar(sorted_x, barx, width=100)


Out[19]:
<Container object of 108 artists>

In [ ]: